package ssx.demo.ssxutils.learn;

public  class Product {
    public  void addSomething(Object o) {
        synchronized(o) {
            if (Main.count == 0) {
                Main.count++;
                System.out.println("生产者：" + Main.count);
                o.notify();
            }else {
                try {
                    o.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
